package com.hd.crdao.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 *
 *@author Programming
 *@date 2017/5/22 0022
 */
public class CarSourcePagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragmentLists;
//    private final String[] titles = {"已上架", "仓库", "草稿"};
    private final String[] titles;

    public CarSourcePagerAdapter(FragmentManager fm, List<Fragment> fragmentLists,String[] titles ) {
        super(fm);
        this.fragmentLists = fragmentLists;
        this.titles =titles;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentLists.get(position);
    }

    @Override
    public int getCount() {
        return fragmentLists.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
